package com.jeewms.www.tms.util;
//editText 输入小写自动转成大写 2018/09/26 yys
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;

public class EditChangedListener implements TextWatcher {
    private EditText et;
    public EditChangedListener(EditText et){
        this.et = et;
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count, int after) {

    }

    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
        et.removeTextChangedListener(this);
        et.setText(s.toString().toUpperCase());
        et.setSelection(s.toString().length());
        et.addTextChangedListener(this);
    }

    @Override
    public void afterTextChanged(Editable s) {

    }
}
